package memory

import (
	"encoding/json"
)

//显示内存数据信息到控制台
func (cache *Memorystore) Show() string {
	cache.Mutex.Lock()
	defer cache.Mutex.Unlock()
	data, err := json.MarshalIndent(cache.Datas, "", "\t")
	if err != nil {
		return "发生错误信息:" + err.Error()
	}
	return string(data)
	//data, _ := json.Marshal(cache.Datas)
	//formatstr := strings.Replace(string(data), "\"", "", -1)
	//return formatstr
}
